﻿CREATE PROCEDURE [dbo].[up_delete_nclass]
 @GroupId nvarchar (10) 
AS
	with my1 as(select * from Groups where GroupId = @GroupId
 union all select Groups.* from my1, Groups where my1.GroupId = Groups.ParentGroupId
)
delete from Groups where exists (select GroupId from my1 where my1.GroupId = Groups.GroupId) 
 